package com.u.iot.engineering.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.u.iot.engineering.entity.AiTask;
import com.u.iot.engineering.mapper.AiTaskMapper;
import com.u.iot.engineering.service.IAiTaskService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Alex Wu
 * @since 2025-03-24
 */
@Service
public class AiTaskServiceImpl extends ServiceImpl<AiTaskMapper, AiTask> implements IAiTaskService {

    private final Integer WORK_STATE = 1;


    @Scheduled(cron = "*/5 * * * * ?") // 每 5 秒执行一次
    public void syncCollectTaskState() {
        System.out.println("采集AI任务状态任务");
        List<AiTask> workStateTasks = this.list(new QueryWrapper<AiTask>().eq("state", WORK_STATE));

    }
}
